CXXFLAGS =	-O3 -g -Wall -fmessage-length=0
#CXXFLAGS = -g -Wall -fmessage-length=0
CXX = g++ $(CXXFLAGS)

OBJS =	randomlib.o differentialevolution.o benchmark.o compactdifferentialevolution.o rand.o util.o

LIBS =

randomlib.o:
	$(CXX) -c randomlib.c $(LIBS)
rand.o:
	$(CXX) -c rand.c $(LIBS)
util.o:
	$(CXX) -c util.cpp $(LIBS)
benchmark.o:
	$(CXX) -c benchmark.cpp $(LIBS)
differentialevolution.o:
	$(CXX) -c differentialevolution.cpp
compactdifferentialevolution.o:
	$(CXX) -c compactdifferentialevolution.cpp

de.o:
	$(CXX) -c de.cpp
de: de.o $(OBJS)
	$(CXX) -o de de.o $(OBJS) $(LIBS)
	
cde.o:
	$(CXX) -DCOMPACT -c de.cpp
cde: cde.o $(OBJS)
	$(CXX) -o cde de.o $(OBJS) $(LIBS)
	
all:	clean de cde

clean:
	rm -f *.o de cde
